package exodus;

/**
 * Created with IntelliJ IDEA.
 * User: JSmith1
 * Date: 7/27/12
 * Time: 11:47 AM
 * An object representing a container loaded with ammunition for use in a ranged weapon.
 */
public class Clip implements Comparable<Clip>{
    //fields
    private String serial; //represents a unique serial number for use in the database.
    private String weapon; //the name of the weapon that this clip fits
    private String ammo; //the ammo type fitting this clip
    private int capacity; //the total number of rounds this clip can hold
    private int quantity; //the current number of rounds loaded into this clip

    //constructors
    public Clip(){}

    public Clip(String serial, String weapon, String ammo, int capacity, int quantity){
        this.serial = serial;
        this.weapon = weapon;
        this.ammo = ammo;
        this.capacity = capacity;
        this.quantity = quantity;
    }

    //getters and setters

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getWeapon() {
        return weapon;
    }

    public void setWeapon(String weapon) {
        this.weapon = weapon;
    }

    public String getAmmo() {
        return ammo;
    }

    public void setAmmo(String ammo) {
        this.ammo = ammo;
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    @Override
    public int compareTo(Clip o) {
        return this.serial.compareTo(o.serial);
    }

    public boolean equals(Clip o){
        return this.serial.equals(o.serial);
    }
}
